﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/INFTUR.master" CodeBehind="VenderPacote.aspx.cs" Inherits="INFTUR.VenderPacote" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="principal">
      <div id="consulta">
      
      
          <asp:ScriptManager ID="ScriptManager1" runat="server">
          </asp:ScriptManager>
          <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
              AutoGenerateColumns="False" DataSourceID="ObjectDataSource3" PageSize="5">
              <Columns>
                  <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                  <asp:BoundField DataField="Data" HeaderText="Data" SortExpression="Data" />
                  <asp:BoundField DataField="Pagamento" HeaderText="Pagamento" 
                      SortExpression="Pagamento" />
                  <asp:BoundField DataField="Pacote" HeaderText="Pacote" 
                      SortExpression="Pacote" />
                  <asp:BoundField DataField="Cliente" HeaderText="Cliente" 
                      SortExpression="Cliente" />
                  <asp:TemplateField HeaderText="Atualizar">
                      <ItemTemplate>
                          <asp:LinkButton ID="lbAtualiza" runat="server" onclick="lbAtualiza_Click">Atualizar</asp:LinkButton>
                      </ItemTemplate>
                  </asp:TemplateField>
                  <asp:TemplateField HeaderText="Remover">
                      <ItemTemplate>
                          <asp:LinkButton ID="lbRemove" runat="server" onclick="lbRemove_Click">Remover</asp:LinkButton>
                          <cc1:ConfirmButtonExtender ID="lbRemove_ConfirmButtonExtender" runat="server" 
                              ConfirmText="Deseja excluir ?" Enabled="True" TargetControlID="lbRemove">
                          </cc1:ConfirmButtonExtender>
                      </ItemTemplate>
                  </asp:TemplateField>
              </Columns>
              <EmptyDataTemplate>
                  <asp:LinkButton ID="Atualizar" runat="server">Atualizar</asp:LinkButton>
              </EmptyDataTemplate>
          </asp:GridView>
          <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
              DataObjectTypeName="Negocios.VendaPacoteBO" DeleteMethod="remover" 
              InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
              SelectMethod="consultarTodos" TypeName="Negocios.VendaPacoteBOMetodos" 
              UpdateMethod="atualizar"></asp:ObjectDataSource>
      
      
      </div>
       
      <div id="cadastro" class="divDados">
      
      
      
          <table >
              <tr>
                  <td >
                      <asp:Label ID="Label1" runat="server" Text="Código"></asp:Label>
                  </td>
                  <td>
                      <asp:TextBox ID="tbCodigo" runat="server" Enabled="False"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                          Text="Nova Venda" />
                  </td>
              </tr>
              <tr>
                  <td >
                      <asp:Label ID="Label2" runat="server" Text="Pacote"></asp:Label>
                  </td>
                  <td>
                      <asp:DropDownList ID="dlPacote" runat="server" DataSourceID="ObjectDataSource1" 
                          DataTextField="Nome" DataValueField="Id" Enabled="False" 
                          AppendDataBoundItems="True">
                          <asp:ListItem Value="0">Selecione Pacote</asp:ListItem>
                      </asp:DropDownList>
                      <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                          DataObjectTypeName="Negocios.PacoteBO" DeleteMethod="remover" 
                          InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
                          SelectMethod="consultarTodos" TypeName="Negocios.PacoteBOMetodos" 
                          UpdateMethod="atualizar"></asp:ObjectDataSource>
                  </td>
              </tr>
              <tr>
                  <td>
                      <asp:Label ID="Label3" runat="server" Text="Cliente"></asp:Label>
                  </td>
                  <td>
                      <asp:DropDownList ID="dlCliente" runat="server" 
                          DataSourceID="ObjectDataSource2" DataTextField="Nome" DataValueField="Cpf" 
                          Enabled="False" AppendDataBoundItems="True">
                          <asp:ListItem Value="0">Selecione Cliente</asp:ListItem>
                      </asp:DropDownList>
                      <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
                          DataObjectTypeName="Negocios.ClienteBO" DeleteMethod="Remove" 
                          InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                          SelectMethod="ConsultaTodos" TypeName="Negocios.ClienteBOMetodos" 
                          UpdateMethod="Atualiza">
                          <DeleteParameters>
                              <asp:Parameter Name="cpf" Type="String" />
                          </DeleteParameters>
                      </asp:ObjectDataSource>
                  </td>
              </tr>
              <tr>
                  <td>
                      <asp:Label ID="Label4" runat="server" Text="Data"></asp:Label>
                  </td>
                  <td>
                      <asp:TextBox ID="tbData" runat="server" Enabled="False"></asp:TextBox>
                      <cc1:CalendarExtender ID="tbData_CalendarExtender" runat="server" 
                          Enabled="True" TargetControlID="tbData">
                      </cc1:CalendarExtender>
                  </td>
              </tr>
              <tr>
                  <td>
                      <asp:Label ID="Label5" runat="server" Text="Forma de Pagamento"></asp:Label>
                  </td>
                  <td>
                      <asp:TextBox ID="tbForma" runat="server" Enabled="False" TextMode="MultiLine"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td class="style2">
                      &nbsp;</td>
                  <td>
                      <asp:Button ID="btGravar" runat="server" onclick="btGravar_Click" 
                          Text="Gravar" Enabled="False" style="height: 26px" />
                      <cc1:ConfirmButtonExtender ID="btGravar_ConfirmButtonExtender" runat="server" 
                          ConfirmText="Confirmar?" Enabled="True" TargetControlID="btGravar">
                      </cc1:ConfirmButtonExtender>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <asp:Button ID="btCancelar" runat="server" onclick="btCancelar_Click" 
                          Text="Cancelar" Enabled="False" />
                  </td>
              </tr>
          </table>
      
      
      
      </div> 
        
    </div>
    <asp:Label ID="lbErro" runat="server" Text="Label"></asp:Label>
   </asp:Content>
